package chem

type Element struct {
	name string
	symbol string
	charge []int
}

var elements []Element

func newElement(atomicNumber int,name string, symbol string, charge []int, diatomic bool){
	element := new(Element)
	element.name=name
	element.symbol=symbol
	element.charge=charge
	elements[atomicNumber]=element
}

func InitElements() {
	newElement(1,"Hydrogen", "H", make([]int, 1, -1),true)
	newElement(2,"Helium", "He", make([]int, 0),false)
	newElement(3,"Lithium", "Li", make([]int, 1),false)
	newElement(4,"Berylium", "Be", make([]int, 2),false)
	newElement(5,"Boron", "B", make([]int, 0),false)
	newElement(6,"Carbon", "C", make([]int, 0),false)
	newElement(7,"Nitrogen", "N", make([]int, -3),true)
	newElement(8,"Oxygen", "O", make([]int, -2),true)
	newElement(9,"Florine", "F", make([]int, -1),true)
	newElement(10,"Neon", "Ne", make([]int, 0),false)
}

func NameElement(symbol string) string {
	for element := range elements {
		if element.symbol==symbol {
			return element.name
		}
	}
}